import time
from datetime import datetime, timedelta

from sc_engine.apps import messages as msgs

#
# Script to run a collection.
SCRIPT_NAME = 'TestScript'

def run(bus):
    start = datetime(2008,10,4)
    end = datetime(2008,10,4)

    date_list = []
    current = start
    while current <= end:
        date_list.append(current)
        current += timedelta(days=1)

    for date in date_list:
        bus.send(msgs.ProleagueFetchRequested(date))

    #bus.send(msgs.ProleagueFetchRequested(datetime(2009,1,17)))
    #bus.send(msgs.ProleagueFetchRequested(datetime(2009,1,18)))

    #bus.send(msgs.YouTubeVideoFetchRequested('UURHp8QRTUA'))
    #bus.send(msgs.ProleagueFetchRequested(datetime(2009,1,6)))

